-
Notifications
You must be signed in to change notification settings - Fork 151
bugfix: Prevent dead units from repeatedly dealing crash damage on collision with non-buildings #2204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…llision with non-buildings
Greptile Overview
|
| Filename | Overview |
|---|---|
| Generals/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp | Added dead unit check to prevent repeated crash damage when colliding with non-buildings |
| GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp | Added dead unit check to prevent repeated crash damage when colliding with non-buildings |
Sequence Diagram
sequenceDiagram
participant Physics as PhysicsBehavior::onCollide
participant Vehicle as Dead Vehicle Object
participant Mine as Mine/Non-Building
participant Weapon as WeaponStore
participant Nearby as Nearby Units/Structures
Note over Physics,Mine: Frame N: Vehicle collides with mine
Physics->>Vehicle: Check if KINDOF_VEHICLE
Physics->>Vehicle: Check if !isEffectivelyDead() [NEW]
alt Vehicle is dead (before fix)
Physics->>Weapon: createAndFireTempWeapon(VehicleCrashesIntoNonBuildingWeapon)
Weapon->>Nearby: Deal damage
Note over Physics,Nearby: Every frame collision persists
else Vehicle is dead (after fix)
Physics-->>Physics: Skip weapon firing
Note over Physics: No damage dealt
end
Note over Physics,Mine: Frame N+1: Still colliding
alt Before fix
Physics->>Weapon: Fire weapon AGAIN
Weapon->>Nearby: Deal damage AGAIN
Note over Nearby: Continuous damage until mine destroyed
else After fix
Physics-->>Physics: Skip - vehicle is dead
end
|
This doesn't properly resolve #2015, the issue with aircraft landing on mines is that the The issue is that the mines block the slow death code from detecting when the chinook hits the ground properly and prevents the carcus from ever clearing itself. |
That sounds like a separate issue? This fix targets the issue as described; "GLA Technical kills/damages building when dying by China Mines". |
Ah yeah, i glanced over it and read the bit about migs and chinooks in the issue as well. The other week Fish and i were looking into the same issue but with aircraft and it is a problem with the death behaviour modules. I don't think your change here will fix their behaviour since they are never properly set to being effectively dead since they remain stuck in their death crash handling. |
Is effectively dead not exactly the status that should apply here? As far as I'm aware that status is applied as soon as health becomes depleted. |
Closes #2015
This change fixes an issue where dead vehicles repeatedly trigger
VehicleCrashesIntoNonBuildingWeaponwhen colliding with mines, causing continuous damage to nearby units and structures.This weapon is hardcoded into the physics update, and is fired when a vehicle falls onto a non-building object - the intent being that a vehicle deals some 'crush' damage to a victim it lands on. It is especially problematic in the case of mines as the mines cannot destroy the already-dead vehicle. The issue is most apparent with Technicals due to their frequent involvement in bombing runs and their tendency to fling themselves forwards upon death.
The fix prevents this weapon from firing if the vehicle is already dead.
There is also a building-specific crash block that fires
VehicleCrashesIntoBuildingWeaponwhen a vehicle crashes into a building, however this results in the immediate destruction of the crashing vehicle, and so is not as problematic.Before
The Propaganda Center dies due to dead Technicals firing
VehicleCrashesIntoNonBuildingWeaponevery frameYES_DAMAGE.mp4
After
The Propaganda Center survives unscathed as dead Technicals no longer fire
VehicleCrashesIntoNonBuildingWeaponNO_DAMAGE.mp4